package com.daxt.common.ureport;

import com.bstek.ureport.UReportPropertyPlaceholderConfigurer;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;


/**
 * @description: 继承UReportPropertyPlaceholderConfigurer, 装载application.yml
 *
 * @author: lig
 * @date: 2021/5/21
 */
public class UReportPropertyConfigurer extends UReportPropertyPlaceholderConfigurer {

    public UReportPropertyConfigurer(String path) {
        YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
        yaml.setResources(new ClassPathResource(path));
        this.setProperties(yaml.getObject());
    }
}
